Skip to content

Add Ren'Py code block highlighting - #17879

Closed
Yinian12 wants to merge 1 commit into
siyuan-note:devfrom
Yinian12:codex/add-renpy-code-highlighting
Closed

Add Ren'Py code block highlighting#17879
Yinian12 wants to merge 1 commit into
siyuan-note:devfrom
Yinian12:codex/add-renpy-code-highlighting

Conversation

@Yinian12

@Yinian12 Yinian12 commented Jun 17, 2026

Copy link
Copy Markdown

Description / 描述

Adds Ren'Py script syntax highlighting to SiYuan code blocks by registering a renpy language, with rpy as an alias, in the bundled third-party Highlight.js language file.

Also bumps the third-languages.js query version from 2.0.1 to 2.0.2 so clients load the updated language bundle instead of a cached copy.

Ren'Py script files are Python-like, but they have their own script statements such as label, scene, show, menu, jump, screen, transform, define, dialogue lines, text interpolation, and text tags. Using python for Ren'Py code blocks produces inaccurate language metadata and incomplete highlighting.

The lightweight Highlight.js grammar is cross-checked against Ren'Py's official VS Code/TextMate grammar, which is MIT licensed: https://github.com/renpy/vscode-language-renpy

Type of change / 变更类型

  • Bug fix
    缺陷修复
  • Refactoring
    代码重构
  • New feature
    新功能
  • Text updates or new language additions
    修改文案或增加新语言

Validation

  • Ran node --check app/stage/protyle/js/highlight.js/third-languages.js
  • Loaded the bundled highlight.min.js and updated third-languages.js in a Node VM, then confirmed that renpy and rpy are registered and Ren'Py samples produce Highlight.js markup for keywords, strings, comments, titles, interpolation, text tags, and backtick strings.
  • Ran git diff --check HEAD^ HEAD

Checklist / 检查清单

  • I have performed a self-review of my own code
    我对自己的代码进行了自我审查
  • I have full rights to the submitted code and agree to license it under this project's AGPL-3.0 license
    我拥有所提交代码的完整权利,并同意其以本项目的 AGPL-3.0 许可证授权
  • PR is submitted to the dev branch and has no merge conflicts
    PR 提交到 dev 分支,并且没有合并冲突

Notes

This is a lightweight Highlight.js grammar intended for code block readability. It does not attempt to parse the full Ren'Py language.

@github-actions

Copy link
Copy Markdown

The base branch of this PR has been automatically changed to dev, please check that there are no merge conflicts.
此 PR 的基础分支已自动更改为 dev,请检查是否存在合并冲突。

@github-actions
github-actions Bot changed the base branch from master to dev June 17, 2026 12:05
@Yinian12
Yinian12 force-pushed the codex/add-renpy-code-highlighting branch 3 times, most recently from d39e0c1 to 2af7114 Compare June 17, 2026 12:31
@Yinian12
Yinian12 force-pushed the codex/add-renpy-code-highlighting branch from 2af7114 to a436dc3 Compare June 17, 2026 12:37
@Yinian12
Yinian12 marked this pull request as ready for review June 17, 2026 12:44
@Yinian12
Yinian12 marked this pull request as draft June 27, 2026 05:59
@Yinian12 Yinian12 closed this Jun 27, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant